package com.cooba.activitys.Living;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.cooba.R;
import com.cooba.bean.LivingDetailBean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class LivingContentTypeActivity extends AppCompatActivity implements View.OnClickListener {

    private TextView add_content_new_type_image_type_tv;
    private TextView add_content_new_type_text_type_tv;
    private List<LivingDetailBean.LivingDetailContent> list;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_living_add_content_new_type);
        list= (List<LivingDetailBean.LivingDetailContent>) getIntent().getSerializableExtra("living_info_list");
        Toast.makeText(this,"数组大小:"+list.size(),Toast.LENGTH_SHORT).show();
        initView();
        initListener();
    }

    private void initListener() {
        add_content_new_type_image_type_tv.setOnClickListener(this);
        add_content_new_type_text_type_tv.setOnClickListener(this);
    }

    private void initView() {
        add_content_new_type_image_type_tv = (TextView) findViewById(R.id.add_content_new_type_image_type_tv);
        add_content_new_type_text_type_tv = (TextView) findViewById(R.id.add_content_new_type_text_type_tv);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.add_content_new_type_text_type_tv:
                Intent intent = new Intent(this, LivingContentAddTextActivity.class);
                intent.putExtra("living_info_list", (Serializable) list);
                startActivity(intent);
                break;
            case R.id.add_content_new_type_image_type_tv:
                Intent intent2 = new Intent(this, LivingContentAddImageActivity.class);
                intent2.putExtra("living_info_list", (Serializable) list);
                startActivity(intent2);
                break;
            default:
                break;
        }
    }
}
